{include file="public_head"}
{include file="public_menu"}
<style>
    .auc_content .tab_con>div{
        display: none;
    }
    .auc_content .tab_con .active{
        display: block;
    }

</style>
<script>
    $(function () {
        $(".header .menu>div .list li").click(
                function () {
                    $(this).addClass("active").siblings().removeClass("active");
                }
        );
        $(".list-auction li").click(
                function () {
                    $(this).addClass("active").siblings().removeClass("active");
                }
        );
        $(".header .menu>div .type").mouseover(
                function () {
                    $(this).find(".menu-group").css({display:"block"});
                }
        );
        $(".header .menu>div .type>div").mouseout(
                function () {
                    $(this).css({display:"none"});
                }
        );
        $(".auc_content .tablist ul li").click(
                function () {
                    var num=$(".tablist li").index(this);
                    $(this).addClass("active").siblings().removeClass("active");
                    $(".tab_con>div").eq(num).css({display:"block"});
                    $(".tab_con>div").eq(num).siblings().css({display:"none"});

                }
        )
    })
</script>
    <!--拍卖详情-->
    <div class="auction-det">
        <div class="auc_cur">
            <a href="#">喜利在线拍卖</a> > <a>{$data.title}专场</a> > <a href="#">{$item.title}</a>
        </div>
        <div class="auc_det_con">
            <div class="auc_det_left">
                <div class="auc_con_left">
                    <div class="show_pic">
                        <div id="showbox">
                            <img src="/{$item.picUrl}" width="347" height="347" />
                        </div><!--展示图片盒子-->
                    </div>
                    <div class="show_det">
                        <div class="title"><a href="#">{$item.title}</a></div>
                        <div class="now">
                            <div class="time">
                                {if condition="$data['end_time'] gt time()"}
                                <div class="state">拍卖中</div>
                                {else/}
                                {if condition="$data['start_time'] gt time()"}
                                <div class="state">未开始</div>
                                {else/}
                                <div class="state">已结束</div>
                                {/if}
                                {/if}
                            </div>
                        </div>
                        <ul class="cur_tips">
                            <li>
                                <span class="cur_state">当 前 价 ：</span><span class="icon_1">￥</span><span class="price_1">{$item.deal_price}</span><span class="num">出价<span>{$count}</span>次</span>
                            </li>
                            <li>
                                <span class="cur_state">保 证 金 ：</span><span class="icon_2">￥</span><span class="price_2">{$item.bond}</span>不成拍则结束后退还
                            </li>
                            <li class="last">
                                <span class="cur_state">参与资格：</span>本次拍卖仅支持注册及以上级别会员参与
                            </li>
                        </ul>
                        {if condition="$data['end_time'] gt time()||$data['start_time'] gt time()"}
                        <div class="enroll">

                            {eq name="bond" value="2"}
                            <a href="javascript:offer();"><img src="__STATIC__/img/icon26.png"><span>交保证金报名</span></a>
                            {else/}
                            <a href="javascript:offer();"><img src="__STATIC__/img/icon26.png"><span>出价</span></a>
                            {/eq}

                        </div>
                        {/if}
                        <div class="det_tips">
                            <table>
                                <tr>
                                    <td><span class="cur_state">起 拍 价：</span>￥{$item.starting_price}</td>
                                    <td>
                                        <span class="cur_state">加价幅度：</span><span class="add">￥{$item.bidding}</span>
                                    </td>
                                </tr>
                                <tr>
                                    <td><span class="cur_state">延时周期：</span>5分钟/次</td>
                                    <td><span class="cur_state">拍卖方式：</span>升价拍</td>
                                </tr>
                            </table>
                        </div>
                        <input type="hidden" id="goods_id" value="{$item.id}">
                        <input type="hidden" id="draw_id" value="{$item.auction_id}">
                        <input type="hidden" id="bond" value="{$bond}">
                    </div>
                </div>
                <div class="auc_step">
                    <table border="0">
                        <tr>
                            <td class="title">竞拍流程：</td>
                            <td class="step"><img src="__STATIC__/img/icon20.png"><span>交保证金</span></td>
                            <td class="and"><img src="__STATIC__/img/next1.png"></td>
                            <td class="step"><img src="__STATIC__/img/icon21.png"><span>参与竞拍</span></td>
                            <td class="and"><img src="__STATIC__/img/next1.png"></td>
                            <td class="step"><img src="__STATIC__/img/icon22.png"><span>竞拍成功</span></td>
                            <td class="and"><img src="__STATIC__/img/next1.png"></td>
                            <td class="step"><img src="__STATIC__/img/icon23.png"><span>支付货款</span></td>
                            <td class="and"><img src="__STATIC__/img/next1.png"></td>
                            <td class="step"><img src="__STATIC__/img/icon24.png"><span>交易完成</span></td>
                        </tr>
                    </table>
                </div>

                <div class="auc_content">
                    <div class="tablist">
                        <ul>
                            <li class="active"><a href="javascript:;">拍品描述</a></li>
                            <li><a href="javascript:;">出价记录（{$count}）</a></li>
                            <li><a href="javascript:;">卖家承诺</a></li>
                            <li><a href="javascript:;">保证金须知</a></li>
                        </ul>
                    </div>
                    <div class="tab_con">
                        <div class="active"> {$item.content}</div>
                        <div>
                            <div class="record">
                                <table>
                                    <tr class="title">
                                        <th class="state">状态</th>
                                        <th class="state">价格</th>
                                        <th class="user">竞拍人</th>
                                        <th class="time">时间</th>
                                    </tr>
                                    {volist name="record" id="vo"}
                                    <tr>
                                        <td class="state">领先</td>
                                        <td class="state">￥{$vo.bind}</td>
                                        <td class="user">{$vo.Member.username}</td>
                                        <td class="time">{:date('Y-m-d H:i:s',$vo.update_time)}</td>
                                    </tr>
                                    {/volist}
                                </table>
                                <div class="page">
                                </div>
                            </div>
                        </div>
                        <div>
                            <div class="promise">
                                {$information[0]['content']}
                            </div>
                        </div>
                        <div>
                            <div class="promise">
                                {$information[1]['content']}
                            </div>
                        </div>
                    </div>
                </div>
            </div>

            <!--左侧拍卖商品-->
            <div class="auc_det_right">
                <div class="auc_market">
                    <div class="tips">进入该拍卖专场</div>
                    <img src="/{$data.picUrl}" class="auc_pic">
                    <div class="now">正在拍卖<span>{$auction_total}</span>件</div>
                    <div class="cus_ser"><a href="{:cache('web_customer_service')}" target="_blank"><img src="__STATIC__/img/icon.png"><span>在线客服</span></a></div>
                </div>
                <div class="list_title">热门拍卖</div>
                <ul class="auc_right_list">
                    {volist name="auction_goods" id="item"}
                    <li>
                        <a href="{:url('Auction/good_detail',['id'=>$item.id])}">
                            <img src="/{$item.picUrl}" class="auc_right_pic">
                            <div class="title">{$item.title}</div>
                            <div class="price">
                                <span>起拍价：￥{$item.starting_price}</span>
                                <div class="time"><span>进入拍卖</span></div>
                            </div>
                        </a>
                    </li>
                    {/volist}
                </ul>
            </div>
            <input type="hidden" id="end_time" value="{$data['end_time']}">
            <!--左侧拍卖商品-->

        </div>
    </div>
{eq name="mm" value="0"}
<script>

    $(function () {
        sh = setInterval('abc()', 30000);


    });

    function abc() {
        // 开始时间
        var end_time = ($('#end_time').val()) * 1000;
        // 当前时间
        var timestamp = Date.parse(new Date());
        // 距离开始五分钟开始刷新页面
        if (end_time > timestamp) {
            location.reload();
        }else {

        }
    }


    // 出价功能
    function offer() {
        var user_id  = "{:session('member_id')}";
        if (user_id==''){
            layer.msg('用户未登录');
            return;
        }
        var goods_id = $('#goods_id').val();
        var draw_id = $('#draw_id').val();
        var bond = $('#bond').val();
        if (bond == 2) {
            window.location.href = "{:url('shop/bond/index')}?goods_id="+goods_id;
            return;
        }

        $.ajax({
            url: "{:url('shop/auction/chujia')}",
            type: 'post',
            data: {'goods_id': goods_id, 'draw_id': draw_id},
            dateType: 'json',
            success: function (data) {

                if (data.code == 200) {
                    var mm = "起拍价" + data.price;
                    $('#jia').html(mm);
                    layer.msg('出价成功！！');
                    location.reload();
                }else if(data.code == 403){
                    layer.msg('拍卖已结束！！');
                }else {
                    layer.msg('您是最高价格不能再出价了！！');
                }
            }
        })
    }



</script>
{/eq}
    {include file="public_foot"}